<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>商品列表</title>
    <!-- jquery -->
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <!-- bootstrap -->
    <link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}"/>
    <script type="text/javascript" th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
    <!-- layer -->
    <script type="text/javascript" th:src="@{/layer/layer.js}"></script>
    <!-- common.js -->
    <script type="text/javascript" th:src="@{/js/common.js}"></script>
</head>
<body>
<div class="panel panel-default">
    <div class="panel-heading">秒杀商品列表</div>
    <table class="table" id="goodslist">
        <tr>
            <td>商品名称</td>
            <td>商品图片</td>
            <td>商品原价</td>
            <td>秒杀价</td>
            <td>库存数量</td>
            <td>详情</td>
        </tr>
        <tr th:each="goods,goodsStat : ${goodsList}">
            <td th:text="${goods.goodsName}"></td>
            <td><img th:src="@{${goods.goodsImg}}" width="100" height="100"/></td>
            <td th:text="${goods.price}"></td>
            <td th:text="${goods.secKillPrice}"></td>
            <td th:text="${goods.stock}"></td>
            <td><a th:href="'/goods/goodsDetail?goodsId='+${goods.goodsId}">详情</a></td>
            <td><a th:href="'/goods/goodsDetail/update?goodsId='+${goods.goodsId}">编辑</a></td>
        </tr>
    </table>

    <div class="panel-heading"><a href="/form/logout">点我注销登录</a></div>

    <div class="panel-heading">
        当前页：<span th:text="${pageInfo.pageId}">8</span> 总页数： <span th:text="${pageInfo.pageCount}">16</span><br>
        <a th:if="${pageInfo.pageId>1}" th:href="@{/goods/toList (pageId=${pageInfo.pageId - 1},rowCount=${5}) }">
            <button class="btn btn-info">上一页</button>
        </a>
        <a th:if="${pageInfo.pageId<pageInfo.pageCount}" th:href="@{/goods/toList (pageId=${pageInfo.pageId + 1},rowCount=${5}) }">
            <button class="btn btn-info">下一页</button>
        </a>

    </div>


</div>
</body>
</html>